import Vue from 'vue';
import App from './App.vue';
import './registerServiceWorker';
import router from './router';
import store from './store';
import Nav from '@/components/Nav.vue';
import Layout from '@/components/Layout.vue';
import Icon from '@/components/Icon.vue';
import NavItem from '@/components/NavItem.vue';
import NavBar from '@/components/NavBar.vue';
import Button from '@/components/Button.vue';

Vue.config.productionTip = false;

//把Nav导航注册为全局组件
Vue.component('Nav', Nav);
Vue.component("Layout",Layout)
Vue.component("Icon",Icon)
Vue.component("NavItem",NavItem)
Vue.component("NavBar",NavBar)
Vue.component("Button",Button)

new Vue({
  router,
  store,
  render: h => h(App),

  beforeCreate() {
    Vue.prototype.$bus = this
  }
}).$mount('#app');

if(document.documentElement.clientWidth > 500){
  alert('请使用手机查看效果更佳！')
}